package com.cw.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.cw.pojo.TbItemCat;
import com.cw.service.ItemService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class SellerCommonController {

    @Reference
    private ItemService itemService;

    @RequestMapping("toHome")
    public String toHome() {

        return "admin/home";
    }

    @RequestMapping("/")
    public String toLogin() {

        return "shoplogin";
    }

    @RequestMapping("toRegister")
    public String toRegister() {

        return "register";
    }

    @RequestMapping("toIndex")
    public String toIndex() {

        return "admin/index";
    }

    @RequestMapping("toAddGoods")
    public String toAddGoods(Model model) {

        List<TbItemCat> itemList = itemService.getItemInfo(0L);

        model.addAttribute("it", itemList);

        return "admin/goods_edit";
    }
}
